package com.thread.blockQueue.generant;

import java.util.concurrent.ArrayBlockingQueue;

/**
 * @Author milian
 * @Date 2021/7/29 0029 17:18
 */
public class cooker extends Thread{
    private ArrayBlockingQueue<String> bd;
    public cooker(ArrayBlockingQueue<String> bd) {
        this.bd = bd;
    }

    @Override
    public void run() {
        while (true){
            try {
                bd.put("汉堡包");
                System.out.println("厨师放了一个汉堡");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
